//
//  GlobalHeader.h
//  投融保
//  全局宏
//  Created by wangan on 13-12-17.
//  Copyright (c) 2013年 木叶科技. All rights reserved.
//

#ifndef ____GlobalHeader_h
#define ____GlobalHeader_h




//NavBar高度
#define NavigationBar_HEIGHT 44

//获取屏幕 宽度、高度
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
//获取系统版本
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
// rgb颜色转换（16进制->10进制）
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]


//方正黑体简体字体定义
#define FONT(F) [UIFont fontWithName:@"FZHTJW--GB1-0" size:F]
//设置背景图片
#define SETBACKGROUND  int _Y=0;if (IOS_VERSION>=7.0){_Y=20;}UIImageView *bgImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, _Y, SCREEN_WIDTH, SCREEN_HEIGHT-_Y)];bgImageView.image = [UIImage imageNamed:@"bg"];[self.view addSubview:bgImageView];

//定义一个API
#define APIURL                @"http://xxxxx/"
//登陆API
#define APILogin              [APIURL stringByAppendingString:@"Login"]

//设置View的tag属性
#define VIEWWITHTAG(_OBJECT, _TAG)    [_OBJECT viewWithTag : _TAG]
//程序的本地化,引用国际化的文件
#define MyLocal(x, ...) NSLocalizedString(x, nil)

//G－C－D
#define BACK(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block)
#define MAIN(block) dispatch_async(dispatch_get_main_queue(),block)
#endif

// 简单alertView
#define ALERTVIEW(message,cancelButton)  UIAlertView *alert=[[UIAlertView alloc] initWithTitle:nil message:message delegate:nil cancelButtonTitle:cancelButton otherButtonTitles:nil, nil];[alert show];
